import axios from '@/libs/request/axios'
import QS from 'qs';

/* ************联系方式变更************ */
// 联系方式申请或暂存过的案件列表
export const getManageContactChangeList = (params,isSP) => {
    return axios.request({
        url: `/${isSP?"apply":"contractManage"}/contactChange/getManageContactChangeList`,
        method: 'POST',
        data: params
    })
};
// 查询合同客户的原联系方式和地址 /contractBasic/oldCustInfo/findContractOldContact
export const findContractOldContact = (params,isSP) => {
    return axios.request({
        url: `${isSP?"/apply":""}/contractGateway/queryRelationChangeOldData`,
        method: 'post',
        data: params,
    })
}
// 新联系方式和地址 contractManage/contactChange/findContractNewContact
export const findContractNewContact = (params,isSP) => {
    return axios.request({
        url: `/${isSP?"apply":"contractManage"}/contactChange/findContractNewContact`,
        data: QS.stringify(params,{arrayFormat: 'repeat'}),
        method: 'post',
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
    })
}
// 变更客户电话和地址  /contractManage/contactChange/changeContactChange
export const changeContactChange = (params,isSP) => {
    return axios.request({
        url: `/${isSP?"apply":"contractManage"}/contactChange/changeContactChange`,
        method: 'post',
        data: params,
    })
}
// 提交
export const changeContactSubmit = (params,isSP) => {
    return axios.request({
        url: `/${isSP?"apply":"contractManage"}/contactChange/changeContactSubmit`,
        method: 'post',
        data: params,
    })
}

//  删除
export const delInfo = (id,isSP) => {
    return axios.request({
        url: `/${isSP?"apply":"contractManage"}/contactChange/delete`,
        data: QS.stringify({id},{arrayFormat: 'repeat'}),
        method: 'post',
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
    })
}
